package com.liy.framework.common.mybatis.druid;

import com.alibaba.druid.filter.FilterChain;
import com.alibaba.druid.support.http.WebStatFilter;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;

@WebFilter(
        filterName = "druidWebStatFilter",
        urlPatterns = {"/druid/*"},
        initParams = {@WebInitParam(
                name = "exclusions",
                value = "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
        )}
)
public class DruidStatFilter extends WebStatFilter {

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        response.setContentType("text/html");
        this.doFilter(request, response, chain);
    }
}
